<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">

        <!-- 一、主列表页 -->
        <div tab heading="借用单" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addApply()"
                        ng-disabled="!btnPermission.borrowInAdd"
                        title="{{!btnPermission.borrowInAdd?'无权限执行此操作':''}}">新增</button>
                    <button class="btn btn-operate m-r-sm" ng-click="batchDel()"
                        ng-disabled="!btnPermission.borrowInDel"
                        title="{{!btnPermission.borrowInDel?'无权限执行此操作':''}}">删除</button>
                    <button class="btn btn-operate m-r-sm" ng-click="batchPrint()"
                        ng-disabled="!btnPermission.borrowInPrint"
                        title="{{!btnPermission.borrowInPrint?'无权限执行此操作':''}}">打印</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="!!btnPermission.borrowInExport || !!btnPermission.borrowInExportAll">
                            <div title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.sectionUrl"
                                    download-param="exportParam.sectionParam" download-key="ids" ng-if="!!btnPermission.borrowInExport">
                                    <i class="yb-icon ico-export-o"></i> 导出
                                </li>
                                <li yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3" ng-if="!!btnPermission.borrowInExportAll">
                                    <i class="yb-icon ico-export-o"></i> 导出全部
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs"
                        ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="借用单号" ng-model="condition.code">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">借用单号：</label>
                        <input type="text" ng-model="condition.code" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">服务信息单号：</label>
                        <input type="text" ng-model="condition.serviceInformationMember" class="form-control">
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="text-center th-check border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allCheckedBill"
                                            yb-click="selectAll(dataList, 'Bill')"></div>
                                    </th>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.billFixedWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, dataList, 'Bill')"></div>
                                    </td>
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="auditApply(item)"
                                                ng-disabled="!btnPermission.borrowInAudit || item.oneLevelAuditStatus === '1'"
                                                title="{{(!btnPermission.borrowInAudit || item.oneLevelAuditStatus === '1')?'无权限执行此操作':''}}">审核</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="editApply(item)"
                                                ng-disabled="!btnPermission.borrowInEdit || item.oneLevelAuditStatus === '1'"
                                                title="{{(!btnPermission.borrowInEdit || item.oneLevelAuditStatus === '1')?'无权限执行此操作':''}}">编辑</button>
                                            <button class="btn btn-operate m-r-xs" ng-click="printSingle(item)"
                                                ng-disabled="!btnPermission.borrowInPrint || item.twoLevelAuditStatus !== '1'"
                                                title="{{(!btnPermission.borrowInPrint || item.twoLevelAuditStatus !== '1')?'无权限执行此操作':''}}">打印</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="delApply(item.id)"
                                                ng-disabled=" item.oneLevelAuditStatus === '1' || !btnPermission.borrowInDel"
                                                title="{{(!btnPermission.borrowInDel ||  item.oneLevelAuditStatus === '1')?'无权限执行此操作':''}}">删除</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="auditApply(item)"
                                                ng-disabled="!btnPermission.borrowInAudit || item.oneLevelAuditStatus === '1'"
                                                title="{{(!btnPermission.borrowInAudit || item.oneLevelAuditStatus === '1')?'无权限执行此操作':''}}">审核</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="editApply(item)"
                                                ng-disabled="!btnPermission.borrowInEdit || item.oneLevelAuditStatus === '1'"
                                                title="{{(!btnPermission.borrowInEdit || item.oneLevelAuditStatus === '1')?'无权限执行此操作':''}}">编辑</button>
                                            <button class="btn btn-operate m-r-xs" ng-click="printSingle(item)"
                                                ng-disabled="!btnPermission.borrowInPrint || item.twoLevelAuditStatus !== '1'"
                                                title="{{(!btnPermission.borrowInPrint || item.twoLevelAuditStatus !== '1')?'无权限执行此操作':''}}">打印</button>
                                            <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="delApply(item.id)"
                                                ng-disabled="item.oneLevelAuditStatus === '1' || !btnPermission.borrowInDel"
                                                title="{{(!btnPermission.borrowInDel || item.oneLevelAuditStatus === '1')?'无权限执行此操作':''}}">删除</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allCheckedBill" yb-check-name="全选"
                    yb-click="selectAll(dataList, 'Bill')"></div>
                <button class="btn btn-operate" ng-click="batchDel()" ng-disabled="!btnPermission.borrowInDel"
                    title="{{!btnPermission.borrowInDel?'无权限执行此操作':''}}">删除</button>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>


        <!-- 二、审核页 -->
        <div tab heading="审核" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">借用单号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.code||'-'}}">
                        {{orderObj.code || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">服务信息单号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.serviceInformationMember||'-'}}">
                        {{orderObj.serviceInformationMember||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">吊机编号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.crantNo||'-'}}">
                        {{orderObj.crantNo||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">领入仓库：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.warehouseLeadIn||'-'}}">
                        {{orderObj.warehouseLeadIn||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">领入库区：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.warehouseAreaLeadIn||'-'}}">
                        {{orderObj.warehouseAreaLeadIn||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">借拆件原因说明：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.borrowReasonDesc||'-'}}">
                        {{orderObj.borrowReasonDesc||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">备注：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.remarks||'-'}}">
                        {{orderObj.remarks||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">预计归还日期：</label>
                    <div class="col-xs-8 wrapper-none spill-dots"
                        title="{{(orderObj.expectedArrivalDate|YbDate:'yyyy-MM-dd HH:mm:ss')||'-'}}">
                        {{(orderObj.expectedArrivalDate|YbDate:'yyyy-MM-dd HH:mm:ss') || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">出厂编号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.factoryNumber ||'-'}}">
                        {{orderObj.factoryNumber || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">借用人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.borrower ||'-'}}">
                        {{orderObj.borrower || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">创建日期：</label>
                    <div class="col-xs-8 wrapper-none spill-dots"
                        title="{{(orderObj.createdDate|YbDate:'yyyy-MM-dd HH:mm:ss')||'-'}}">
                        {{(orderObj.createdDate|YbDate:'yyyy-MM-dd HH:mm:ss') || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">批次号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.batchNo ||'-'}}">
                        {{orderObj.batchNo || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">联系人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.linkMan||'-'}}">
                        {{orderObj.linkMan || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">联系电话：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.linkPhone || '-'}}">
                        {{orderObj.linkPhone || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">拆/借：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.isBorrow || '-'}}">
                        {{orderObj.isBorrow || "-"}}
                    </div>
                </div>
            </div>
            <div class="panel-bar pos-a clearfix" style="left:0;right: 240px;">
                <div class="pull-left">
                    <i></i>零件信息
                </div>
            </div>
            <div class="panel-bar pos-a clearfix" style="right: 0; width: 225px;">
                <div class="pull-left">
                    <i></i>审核意见
                </div>
            </div>
            <div class="main-area d-b-60" style="top:220px; right: 240px;">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="editMaterielConfig.scrollWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.borrowMaterialDetailDOList.length > 0">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.borrowMaterialDetailDOList track by $index">
                                    <td class="spill-dots"
                                        ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}">
                                        {{item[itemCol.dataField]}}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t"
                        ng-show="orderObj.borrowMaterialDetailDOList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="main-area d-b-60" style="top:220px; left: auto; width: 225px;">
                <div class="main-wrap p-b-lg over-flow-h">
                    <textarea yb-word-count max-size="100" name="auditOpinion" class="form-control full"
                        ng-model="orderObj.auditOpinion" ng-class="{'error': !orderObj.auditOpinion && submitted}"
                        placeholder="审核意见"></textarea>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-click="auditPurchase('pass', orderObj.id, orderObj.auditOpinion)">通过</button>
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-click="auditPurchase('refuse', orderObj.id, orderObj.auditOpinion)">拒绝</button>
                <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
            </div>
        </div>


        <!-- 三、新增页 -->
        <div tab heading="{{tabFlag.name}}" active="activeFlag[2]" ng-if="activeFlag[2]">
            <form name="orderForm" class="m-t-sm form-horizontal form-up-tb border-b clearfix" novalidate>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!!orderObj.code">
                    <label class="col-xs-4 control-label max-w-100">借用单号：</label>
                    <div class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.code}}">
                        {{orderObj.code}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>服务信息单：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="serviceInformationMember" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.serviceInformationMember" required yb-focus>
                        <div class="msg-block"
                            ng-if="orderForm.serviceInformationMember.$dirty || (orderForm.serviceInformationMember.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.serviceInformationMember.$error.required && !orderForm.serviceInformationMember.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>吊机编号：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="crantNo" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.crantNo" required yb-focus>
                        <div class="msg-block"
                            ng-if="orderForm.crantNo.$dirty || (orderForm.crantNo.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.crantNo.$error.required && !orderForm.crantNo.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>领入仓库：</label>
                    <div class="col-xs-8 wrapper-none">
                        <!-- <div yb-form-clear ng-model="orderObj.warehouseLeadIn" select-obj="selectWarehouse()"
                            clear-form="clearWarehouse()" tips-name="领入仓库" form-require="true"></div> -->
                        <input type="text" name="warehouseLeadIn" class="form-control light-bg cursor-pointer"
                            ng-model="orderObj.warehouseLeadIn" ng-click="selectWarehouse()" required yb-focus readonly
                            placeholder="请选择">
                        <div class="msg-block"
                            ng-if="orderForm.warehouseLeadIn.$dirty || (orderForm.warehouseLeadIn.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.warehouseLeadIn.$error.required && !orderForm.warehouseLeadIn.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                        <!-- <div class="msg-block" ng-if="!orderForm.warehouseLeadIn && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div> -->
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>领入库区：</label>
                    <div class="col-xs-8 wrapper-none">
                        <!-- <div yb-form-clear ng-model="orderObj.warehouseAreaLeadIn" select-obj="selectArea()"
                            clear-form="clearArea()" tips-name="领入库区" form-require="true">
                        </div>
                        <div class="msg-block" ng-if="!orderForm.warehouseAreaLeadIn && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div> -->
                        <input type="text" name="warehouseAreaLeadIn" class="form-control light-bg cursor-pointer"
                            ng-model="orderObj.warehouseAreaLeadIn" ng-click="selectArea()" required yb-focus readonly
                            placeholder="请选择">
                        <div class="msg-block"
                            ng-if="orderForm.warehouseAreaLeadIn.$dirty || (orderForm.warehouseAreaLeadIn.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.warehouseAreaLeadIn.$error.required && !orderForm.warehouseAreaLeadIn.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i>借拆件原因说明：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="borrowReasonDesc" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.borrowReasonDesc" required yb-focus>
                        <div class="msg-block"
                            ng-if="orderForm.borrowReasonDesc.$dirty || (orderForm.borrowReasonDesc.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.borrowReasonDesc.$error.required && !orderForm.borrowReasonDesc.focused">
                                <div class="msg-triangle"></div>
                                必填项，请填写
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">备注：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="remarks" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.remarks" yb-focus>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>预计归还日期</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="expectedArrivalDate" class="form-control date-picker"
                            ng-model="orderObj.expectedArrivalDate" datepicker-popup="{{'yyyy-MM-dd'}}"
                            ng-click="showDatepicker1 = !showDatepicker1" is-open="showDatepicker1" close-text="关闭"
                            readonly required>
                        <div class="msg-block"
                            ng-show="orderForm.expectedArrivalDate.$dirty || (orderForm.expectedArrivalDate.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.expectedArrivalDate.$error.required && !orderForm.expectedArrivalDate.focused">
                                <div class="msg-triangle"></div>
                                <span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">出厂编号：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="factoryNumber" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.factoryNumber" yb-focus>
                    </div>
                </div>
                <!-- 借用人填入当前登录人 -->
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">借用人：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="borrower" class="form-control light-bg" ng-model="orderObj.borrower"
                            yb-focus readonly placeholder="请选择">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!(tabFlag.type===1)">
                    <label class="col-xs-4 control-label max-w-100"><span translate>创建日期</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="createdDate" class="form-control date-picker"
                            ng-model="orderObj.createdDate" datepicker-popup="{{'yyyy-MM-dd'}}"
                            ng-click="showDatepicker2 = !showDatepicker2" is-open="showDatepicker2" close-text="关闭"
                            readonly>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!(tabFlag.type===1)">
                    <label class="col-xs-4 control-label max-w-100">批次号：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="batchNo" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.batchNo" yb-focus>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!(tabFlag.type===1)">
                    <label class="col-xs-4 control-label max-w-100">联系人：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="linkPhone" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.linkMan" yb-focus>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!(tabFlag.type===1)">
                    <label class="col-xs-4 control-label max-w-100">联系电话：</label>
                    <div class="col-xs-8 wrapper-none">
                        <input type="text" name="linkPhone" class="form-control light-bg" maxlength="20"
                            ng-model="orderObj.linkPhone" yb-focus>
                        <div class="msg-block"
                            ng-show="orderForm.linkPhone.$dirty || (orderForm.linkPhone.$invalid && submitted)">
                            <div class="error-msg"
                                ng-if="orderForm.linkPhone.$error.mobile && !orderForm.linkPhone.focused">
                                <div class="msg-triangle"></div>
                                手机号格式错误
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" ng-if="!(tabFlag.type===1)">
                    <label class="col-xs-4 control-label max-w-100">拆/借：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select name="isBorrow" class="form-control" ng-model="orderObj.isBorrow"
                            ng-options="item.code as item.name for item in isBorrowType" yb-focus>
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
            </form>
            <div class="row wrapper-y-xs">
                <div class="col-xs-12 operate-bar font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="selMateriel($event)">选择零件</button>
                    <button class="btn btn-operate m-r-sm" ng-click="batchDelMateriel()">批量删除</button>
                </div>
            </div>
            <div materiel-selector show-toolbar="toolbarConfig.showMateriel"
                selected-list="orderObj.borrowMaterialDetailDOList"></div>

            <div class="main-area d-b-60" ng-style="{top: tabFlag.type == 2 ? '260px' : '215px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="th-check text-center">
                                        <div yb-check-box yb-checked="markInfo.allCheckedMaterial"
                                            yb-click="selectAll(orderObj.borrowMaterialDetailDOList, 'Material')"></div>
                                    </th>
                                    <th width="60" class="text-center">
                                        操作
                                    </th>
                                    <th ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="materielTableConfig.targetWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.borrowMaterialDetailDOList.length > 0">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.borrowMaterialDetailDOList track by $index">
                                    <td width="40" class="text-center">
                                        <div yb-check-box yb-checked="item.isChecked"
                                            yb-click="selectSingle(item, orderObj.borrowMaterialDetailDOList, 'Material')">
                                        </div>
                                    </td>
                                    <td width="60">
                                        <button type="button" class="btn btn-operate"
                                            ng-click="delMateriel(item, $index)">删除</button>
                                    </td>
                                    <td ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}">
                                        <div class="spill-dots" ng-if="!itemCol.needInput && !itemCol.needInputNumber">
                                            <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                                ng-if="!!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </a>
                                            <span ng-if="!itemCol.clickFn">
                                                {{item[itemCol.dataField]}}
                                            </span>
                                        </div>
                                        <div ng-if="itemCol.needInputNumber" class="td-edit pos-r">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                ng-change="countTotal(item)" yb-number-input max="99999.999"
                                                maxlength="9" disable-decimal="false" decimal-places="3"
                                                ng-class="{'error': item.qtyErr}">
                                            <div class="pos-a tool-tips" ng-if="!!item.qtyErr">
                                                <i class="triangle"></i>
                                                <div class="msg">数量不能为空和0</div>
                                            </div>
                                        </div>
                                        <div ng-if="itemCol.needInput" class="td-edit pos-r">
                                            <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                                maxlength="100">
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t"
                        ng-show="orderObj.borrowMaterialDetailDOList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm"
                    ng-click="saveData('save', orderForm.$valid)">保存</button>
                <!-- <button type="button" class="btn btn-primary m-r-sm"
                    ng-click="saveData('submit', orderForm.$valid)">提交</button> -->
                <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
            </div>
        </div>


        <!-- 四、详情页 -->
        <div tab heading="详情" active="activeFlag[3]" ng-if="activeFlag[3]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">借用单号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.code||'-'}}">
                        {{orderObj.code || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">服务信息单号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.serviceInformationMember||'-'}}">
                        {{orderObj.serviceInformationMember||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">吊机编号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.crantNo||'-'}}">
                        {{orderObj.crantNo||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">领入仓库：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.warehouseLeadIn||'-'}}">
                        {{orderObj.warehouseLeadIn||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">领入库区：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.warehouseAreaLeadIn||'-'}}">
                        {{orderObj.warehouseAreaLeadIn||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-5 m-b-n text-right max-w-105">借拆件原因说明：</label>
                    <div class="col-xs-7 wrapper-none spill-dots" title="{{orderObj.borrowReasonDesc||'-'}}">
                        {{orderObj.borrowReasonDesc||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">备注：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.remarks||'-'}}">
                        {{orderObj.remarks||'-'}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">预计归还日期：</label>
                    <div class="col-xs-8 wrapper-none spill-dots"
                        title="{{(orderObj.expectedArrivalDate|YbDate:'yyyy-MM-dd HH:mm:ss')||'-'}}">
                        {{(orderObj.expectedArrivalDate|YbDate:'yyyy-MM-dd HH:mm:ss') || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">出厂编号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.factoryNumber ||'-'}}">
                        {{orderObj.factoryNumber || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">借用人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.borrower ||'-'}}">
                        {{orderObj.borrower || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">创建日期：</label>
                    <div class="col-xs-8 wrapper-none spill-dots"
                        title="{{(orderObj.createdDate|YbDate:'yyyy-MM-dd HH:mm:ss')||'-'}}">
                        {{(orderObj.createdDate|YbDate:'yyyy-MM-dd HH:mm:ss') || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">批次号：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.batchNo ||'-'}}">
                        {{orderObj.batchNo || "-"}}
                    </div>
                </div>
                <!-- 借用单状态显示两个状态：一级审核和二级审核 -->
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">一级审核状态：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.oneLevelAuditStatus||'-'}}">
                        {{orderObj.oneLevelAuditStatus || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">二级审核状态：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.twoLevelAuditStatus||'-'}}">
                        {{orderObj.twoLevelAuditStatus || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">联系人：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.linkMan||'-'}}">
                        {{orderObj.linkMan || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">联系电话：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.linkPhone || '-'}}">
                        {{orderObj.linkPhone || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">拆/借：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.isBorrow || '-'}}">
                        {{orderObj.isBorrow || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">一级审核意见：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.auditOpinion ||'-'}}">
                        {{orderObj.auditOpinion || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100">二级审核意见：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{orderObj.auditRemarks ||'-'}}">
                        {{orderObj.auditRemarks || "-"}}
                    </div>
                </div>
            </div>
            <div class="panel-bar clearfix">
                <div class="pull-left">
                    <i></i>零件信息
                </div>
            </div>
            <div class="main-area d-b-60" style="top:290px;">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}">
                                        <div yb-thead-operate ng-model="itemCol"
                                            target-width="editMaterielConfig.scrollWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="orderObj.borrowMaterialDetailDOList.length > 0">
                        <table class="table-fixed border-none" width="{{materielTableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in orderObj.borrowMaterialDetailDOList track by $index">
                                    <td class="spill-dots"
                                        ng-repeat="itemCol in materielTableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" title="{{item[itemCol.dataField]}}">
                                        {{item[itemCol.dataField]}}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t"
                        ng-show="orderObj.borrowMaterialDetailDOList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-default" ng-click="cancel()">返回</button>
            </div>
        </div>
    </div>
</div>